package com.lnsf.bookstore.system.topicBook.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.topicBook.dao.TopicBookMapper;
import com.lnsf.bookstore.system.topicBook.vo.TopicBook;
import com.lnsf.bookstore.system.topicBook.service.TopicBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class TopicBookServiceImpl implements TopicBookService {

    @Autowired
    private TopicBookMapper topicBookMapper;


    @Override
    public int save(TopicBook topicBook) {
        return topicBookMapper.insertSelective(topicBook);
    }

    @Override
    public TopicBook queryObject(Integer id) {
        return topicBookMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return topicBookMapper.deleteBatch(ids);
    }

    @Override
    public int update(TopicBook topicBook) {
        return topicBookMapper.updateByPrimaryKeySelective(topicBook);
    }

    @Override
    public PageInfo<TopicBook> queryList(Map<String, Object> params) {
        return new PageInfo<TopicBook>(topicBookMapper.queryList(params));
    }
}
